﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TravelManagement
{
    /*
          {
               "rows":[
                           {
                               "elements":
                               [
                                   {
                                       "distance":{"text":"1 m","value":0},
                                       "duration":{"text":"1 min","value":0},
                                       "status":"OK"
                                   },
                                   
                                   {   
                                       "distance":{"text":"3.2 km","value":3200},
                                       "duration":{"text":"9 mins","value":565},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"4.4 km","value":4400},
                                       "duration":{"text":"9 mins","value":543},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"3.1 km","value":3144},
                                       "duration":{"text":"7 mins","value":446},
                                       "status":"OK"
                                   }
                               ]
                       },
                       
                       {
                           "elements":
                               [
                                   {
                                       "distance":{"text":"2.7 km","value":2707},
                                       "duration":{"text":"8 mins","value":465},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"1 m","value":0},
                                       "duration":{"text":"1 min","value":0},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"2.2 km","value":2230},
                                       "duration":{"text":"6 mins","value":362},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"4.9 km","value":4879},
                                       "duration":{"text":"12 mins","value":709},
                                       "status":"OK"
                                   }
                               ]
                       },
                       
                       {
                           "elements":
                               [
                                   {
                                       "distance":{"text":"4.6 km","value":4552},
                                       "duration":{"text":"12 mins","value":696},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"3.5 km","value":3487},
                                       "duration":{"text":"9 mins","value":516},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"1 m","value":0},
                                       "duration":{"text":"1 min","value":0},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"3.2 km","value":3200},
                                       "duration":{"text":"10 mins","value":587},
                                       "status":"OK"
                                   }
                               ]
                       },
                       
                       {
                           "elements":
                               [
                                   {
                                       "distance":{"text":"2.6 km","value":2617},
                                       "duration":{"text":"7 mins","value":422},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"4.8 km","value":4810},
                                       "duration":{"text":"10 mins","value":605},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"3.5 km","value":3492},
                                       "duration":{"text":"8 mins","value":485},
                                       "status":"OK"
                                   },
                                   
                                   {
                                       "distance":{"text":"1 m","value":0},
                                       "duration":{"text":"1 min","value":0},
                                       "status":"OK"
                                   }
                               ]
                       }
               ],
               
               "originAddresses":
                           [
                               "Queens Rd, SR Nagar, Bengaluru, Karnataka, India",
                               "M G Rd, Ashok Nagar, Sivanchetti Gardens, Bengaluru, Karnataka, India",
                               "Alexandria St, Richmond Town, Bengaluru, Karnataka, India",
                               "Avenue Rd, Anchepet, Chickpete, Bengaluru, Karnataka, India"
                           ],
               
               "destinationAddresses":
                           [
                               "Queens Rd, SR Nagar, Bengaluru, Karnataka, India",
                               "M G Rd, Ashok Nagar, Sivanchetti Gardens, Bengaluru, Karnataka, India",
                               "Alexandria St, Richmond Town, Bengaluru, Karnataka, India",
                               "Avenue Rd, Anchepet, Chickpete, Bengaluru, Karnataka, India"
                           ]
           }
      
      Converted to C# class using http://json2csharp.com/
     */


    public class Distance
    {
        public string text { get; set; }
        public int value { get; set; }
    }

    public class Duration
    {
        public string text { get; set; }
        public int value { get; set; }
    }

    public class Element
    {
        public Distance distance { get; set; }
        public Duration duration { get; set; }
        public string status { get; set; }
    }

    public class Row
    {
        public Element[] elements { get; set; }
    }

    public class RootObject
    {
        public Row[] rows { get; set; }
        public string[] originAddresses { get; set; }
        public string[] destinationAddresses { get; set; }
    }
}